<?php

declare(strict_types=1);

namespace App\Request\User;

use Hyperf\Validation\Request\FormRequest;

class UserMemberCardUseHandleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'account_id' => 'required',
            'cid' => 'required',
            'cate_id' => 'required',
            'amount' => 'required',
            'signature' => 'required',
            'remark' => 'nullable',
        ];
    }

    public function messages(): array
    {
        return [
            'account_id.required' => '入账账户不能为空',
            'cid.required' => '会员卡ID不能为空',
            'cate_id.required' => '所属类目不存在',
            'amount.required' => '使用金额不能为空',
            'signature.required' => '签名信息不能为空',
        ];
    }
}
